package com.ruoyi.binance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.binance.mapper.BinanceAPriceMonitoringMapper;
import com.ruoyi.binance.domain.BinanceAPriceMonitoring;
import com.ruoyi.binance.service.IBinanceAPriceMonitoringService;

/**
 * 均价监控AService业务层处理
 *
 * @author zq
 * @date 2025-08-14
 */
@Service
public class BinanceAPriceMonitoringServiceImpl implements IBinanceAPriceMonitoringService
{
    @Autowired
    private BinanceAPriceMonitoringMapper binanceAPriceMonitoringMapper;

    /**
     * 查询均价监控A
     *
     * @param code 均价监控A主键
     * @return 均价监控A
     */
    @Override
    public BinanceAPriceMonitoring selectBinanceAPriceMonitoringByCode(String code)
    {
        return binanceAPriceMonitoringMapper.selectBinanceAPriceMonitoringByCode(code);
    }

    /**
     * 查询均价监控A列表
     *
     * @param binanceAPriceMonitoring 均价监控A
     * @return 均价监控A
     */
    @Override
    public List<BinanceAPriceMonitoring> selectBinanceAPriceMonitoringList(BinanceAPriceMonitoring binanceAPriceMonitoring)
    {
        return binanceAPriceMonitoringMapper.selectBinanceAPriceMonitoringList(binanceAPriceMonitoring);
    }

    /**
     * 新增均价监控A
     *
     * @param binanceAPriceMonitoring 均价监控A
     * @return 结果
     */
    @Override
    public int insertBinanceAPriceMonitoring(BinanceAPriceMonitoring binanceAPriceMonitoring)
    {
        binanceAPriceMonitoring.setCreateTime(DateUtils.getNowDate());
        return binanceAPriceMonitoringMapper.insertBinanceAPriceMonitoring(binanceAPriceMonitoring);
    }

    /**
     * 修改均价监控A
     *
     * @param binanceAPriceMonitoring 均价监控A
     * @return 结果
     */
    @Override
    public int updateBinanceAPriceMonitoring(BinanceAPriceMonitoring binanceAPriceMonitoring)
    {
        binanceAPriceMonitoring.setUpdateTime(DateUtils.getNowDate());
        return binanceAPriceMonitoringMapper.updateBinanceAPriceMonitoring(binanceAPriceMonitoring);
    }

    /**
     * 批量删除均价监控A
     *
     * @param codes 需要删除的均价监控A主键
     * @return 结果
     */
    @Override
    public int deleteBinanceAPriceMonitoringByCodes(String[] codes)
    {
        return binanceAPriceMonitoringMapper.deleteBinanceAPriceMonitoringByCodes(codes);
    }

    /**
     * 删除均价监控A信息
     *
     * @param code 均价监控A主键
     * @return 结果
     */
    @Override
    public int deleteBinanceAPriceMonitoringByCode(String code)
    {
        return binanceAPriceMonitoringMapper.deleteBinanceAPriceMonitoringByCode(code);
    }
}
